const components = require.context('.', true, /\.vue$/)

const GlobalComponents = {
  install(Vue) {
    components.keys().forEach(path => {
      let component = components(path).default
      Vue.component(component.name, component)
    })
  }
}

// const vueComponents = Vue => {
//   components.keys().forEach(path => {
//     let component = components(path).default
//     Vue.component(component.name, component)
//   })
// }

export default GlobalComponents
